package com.jugheadzhou.client.controller;

import com.jugheadzhou.client.service.TestRemoteService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author jugheadzhou
 * @date 2021-10-01
 */
@Slf4j
@RestController
@RequestMapping("test/")
public class TestController {

    @Resource
    private TestRemoteService remoteService;

    /**
     * 测试通过feign远程调用服务
     *
     * @return
     */
    @GetMapping("info/{name}")
    public ResponseEntity<?> hello(@PathVariable("name") String name){
        log.info("开始调用测试通过feign远程调用服务接口");
        String result = remoteService.hello(name);
        log.info("远程调用结果：{}" + result);
        return ResponseEntity.ok(result);
    }



}
